home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / VIS082S.ARJ / NODEEDIT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-03-09  |  9KB  |  312 lines

  1. Program NodeLists;        (* Generic program to
  2.                              set up the node lists for
  3.                              netmail ver 1.01 *)
  4.  
  5. Uses Crt,Dos,Gentypes,Configrt,GenSubs,PullTTT5;
  6.  
  7. Var Node:NodeNetRec;
  8.     Fn:File of NodeNetRec;
  9.     Input:String;
  10.     I,J,Cnt:Integer;
  11.     C:Char;
  12.     TheMenu:Pull_Array;
  13.     Major,Minor:Byte;
  14.  
  15. Procedure ShowNode;
  16. Begin
  17.   ClrScr;
  18.   WriteLn('Node #',i);
  19.   WriteLn('Node Password        :',node.Pass);
  20.   WriteLn('Node Name            :',Node.Name);
  21.   WriteLn('Node Phone Number    :',Node.Phone);
  22.   WriteLn('Node Baud Rate       :',Node.Baud);
  23.   WriteLn('Node ID Number       :',Node.Node);
  24.   WriteLn;
  25.   WriteLn('Press Any Key to View Bases Netted.');
  26.   C:=ReadKey;
  27.   ClrScr;
  28.   For I:=1 to 255 Do
  29.     If Node.BaseSelection[I] Then WriteLn('Base Id #',I,' is NetWorked.');
  30.   WriteLn;
  31.   Write('Press Any Key to Continue.');
  32.   C:=ReadKey;
  33.   End;  (* End ShowNode *)
  34.  
  35. Procedure DisplayNodeInformation;
  36. Begin
  37.   ClrScr;
  38.   Write('Which Node to List:[1-',filesize(Fn),']:');
  39.   ReadLn(Input);
  40.   I:=Valu(Input);
  41.   If (I<1) or (I>(FileSize(Fn))) Then Else Begin
  42.   Seek(Fn,I-1);
  43.   Read(Fn,Node);
  44.   ShowNode;
  45.   End; (* End If then Begin *)
  46. End; (* End DisplayNodeInformation *)
  47.  
  48. Procedure InitializeThisStuff;
  49. Begin
  50.   ReadConfig;
  51.   Assign(Fn,ConfigSet.ForumDi+'NodeList.BBS');
  52.   If Exist (ConfigSet.ForumDi+'NodeList.BBS') then
  53.     Reset(Fn) Else ReWrite(Fn);
  54.   ClrScr;
  55.   WriteLn('ViSiON BBS Cheap and Sleazy Node Editor Version 1.00');
  56.   GotoXy(24,23);
  57.   Write('Press Any Key To Continue');
  58.   C:=ReadKey;
  59.   ClrScr;
  60.   FillChar(TheMenu,SizeOf(TheMenu),0);
  61.   TheMenu[1]:='\Node Maintenance';
  62.   TheMenu[2]:='List Nodes';
  63.   TheMenu[3]:='Edit a Node';
  64.   TheMenu[4]:='Delete a Node';
  65.   TheMenu[5]:='\Add a Node      ';
  66.   TheMenu[6]:='\About Node Edit ';
  67.   TheMenu[7]:='\Quit Node Editor';
  68.   TheMenu[8]:='\\';
  69.   Major:=1;
  70.   Minor:=1;
  71. End;         (* End InitializeThisStuff *)
  72.  
  73. Procedure AboutNodeEdit;
  74. Begin
  75.   ClrScr;
  76.   WriteLn('ViSiON Node Editor Version 1.00 is written using TechnoJocks Toolkit.');
  77.   WriteLn('It was written for the implementation of NetWorking version 1.01 which is');
  78.   WriteLn('A TRUE Bi-Directional NetMail routine.');
  79.   WriteLn('This program will be implemented in a rather condensed form in ViSiON BBS');
  80.   WriteLn('Some time in the near future. Thank you.');
  81.   GotoXy(24,23);
  82.   Write('Press Any Key to Continue.');
  83.   C:=ReadKey;
  84. End;               (* End AboutNodeEdit *)
  85.  
  86.  
  87. Procedure AddNode;
  88. Begin
  89.   ClrScr;
  90.   FillChar(Node,SizeOf(Node),0);
  91.   Write('Enter Node Password:');
  92.   ReadLn(Input);
  93.   If Input='' then Exit;
  94.   Node.Pass:=Input;
  95.   Write('Enter Node Name:');
  96.   ReadLn(Input);
  97.   If Input='' then Exit;
  98.   Node.Name:=Input;
  99.   WriteLn('For this do NOT include any "-"s or "("s');
  100.   Write('Enter Node Phone Number:');
  101.   ReadLn(Input);
  102.   If Input='' then Exit;
  103.   Node.Phone:=Input;
  104.   Write('Enter node Baud Rate (ex:38400):');
  105.   ReadLn(Input);
  106.   If Input='' then Exit;
  107.   If Input='1200' then Node.Baud:=1200;
  108.   If Input='2400' then Node.Baud:=2400;
  109.   If Input='4800' then Node.Baud:=4800;
  110.   If Input='9600' then Node.Baud:=9600;
  111.   If Input='19200' then Node.Baud:=19200;
  112.   If Input='38400' then Node.Baud:=38400;
  113.   Write('Enter Node ID Address:');
  114.   ReadLn(Input);
  115.   If Input='' then Exit;
  116.   Node.Node:=Input;
  117.   ClrScr;
  118.   WriteLn('Now we are going to pick the BASE ID''s to be networked.');
  119.   WriteLn('Just enter the net ID''s that you WISH to pick up and then enter');
  120.   WriteLn('A "0" when you are done.');
  121.    Repeat
  122.      Write('Base Id:');
  123.      ReadLn(Input);
  124.      I:=Valu(Input);
  125.      If (I>0) and (I<256) then Node.BaseSelection[I]:=True;
  126.      If (I>255) or (I<0) then WriteLn('Invalid range!');
  127.    Until I=0; (* End Repeat Loop *)
  128.    Write('Adding node to list...');
  129.    Seek(Fn,FileSize(Fn));
  130.    Write(Fn,Node);
  131.    WriteLn('Completed!');
  132.    WriteLn('Press Any Key to Continue.');
  133.    C:=ReadKey;
  134.   End;               (* End AddNode *)
  135.  
  136. Procedure DeleteNode;
  137. Begin
  138.   ClrScr;
  139.   Write('Whice Node to Delete [1-',filesize(Fn),']:');
  140.   ReadLn(Input);
  141.   I:=Valu(Input);
  142.   If (I<1) or (I>FileSize(Fn)) then Exit;
  143.   Write('Deleting Node...');
  144.   Dec(I);
  145.   For Cnt:=i to FileSize(Fn)-2 do Begin
  146.     Seek(Fn,Cnt+1);
  147.     Read(Fn,Node);
  148.     Seek(Fn,Cnt);
  149.     Write(Fn,Node);
  150.   End;
  151.   Seek(Fn,FileSize(Fn)-1);
  152.   Truncate(Fn);
  153.   Close(Fn);
  154.   Assign(Fn,Configset.ForumDi+'NodeList.BBS');
  155.   Reset(Fn);
  156.   WriteLn('Deleted.');
  157.   WriteLn;
  158.   WriteLn('Press Any Key to Continue.');
  159.   C:=ReadKey;
  160. End; (* End DeleteNode *)
  161.  
  162. Procedure EditNode;
  163. Var EditMenu:Pull_Array;
  164.     EMajor,EMinor:Byte;
  165.     NodeNum:Integer;
  166.  
  167.   Procedure InitEditor;
  168.   Begin
  169.     FillChar(EditMenu,SizeOf(EditMenu),0);
  170.     EMajor:=1;
  171.     Eminor:=1;
  172.     EditMenu[1]:='\General Editing ';
  173.     EditMenu[2]:='Phone Number';
  174.     EditMenu[3]:='Baud Rate';
  175.     EditMenu[4]:='Node Name';
  176.     EditMenu[5]:='Show Node Info';
  177.     EditMenu[6]:='\Specific Editing';
  178.     EditMenu[7]:='Node Password';
  179.     EditMenu[8]:='Node ID Number';
  180.     EditMenu[9]:='\Net Worked Bases';
  181.     EditMenu[10]:='\Quit Editing    ';
  182.     EditMenu[11]:='\\';
  183.   End; (* End InitEditor *)
  184.  
  185.   Procedure GetPhoneNum;
  186.   Begin
  187.     ClrScr;
  188.     Write('Enter the NEW Phone Number for this Node:');
  189.     ReadLn(Input);
  190.     If Input<>'' then Node.Phone:=Input;
  191.   End;  (* End GetPhoneNum *)
  192.  
  193.   Procedure GetName;
  194.   Begin
  195.     ClrScr;
  196.     Write('Enter the NEW Name for this Node:');
  197.     ReadLn(Input);
  198.     If Input<>'' then Node.Name:=Input;
  199.   End; (* End GetName *)
  200.  
  201.   Procedure GetBaud;
  202.   Begin
  203.     ClrScr;
  204.     Write('Enter the New baud Rate for this node:');
  205.     ReadLn(Input);
  206.     If Input='1200' then Node.Baud:=1200
  207.       Else
  208.     If Input='2400' then Node.baud:=2400
  209.       Else
  210.     If Input='4800' then Node.Baud:=4800
  211.       Else
  212.     If Input='9600' then Node.Baud:=9600
  213.       Else
  214.     If Input='19200' then Node.Baud:=19200
  215.       Else
  216.     If Input='38400' then Node.Baud:=38400;
  217.   End; (* End GetBaud *)
  218.   Procedure NodePassword;
  219.   Begin
  220.     ClrScr;
  221.     Write('Enter the NEW Node Password:');
  222.     ReadLn(Input);
  223.     If Input<>'' then Node.Pass:=Input;
  224.   End; (* End NodePassword *)
  225.  
  226.   Procedure NodeIDNumber;
  227.   Begin
  228.     ClrScr;
  229.     Write('Enter the NEW Node ID Number:');
  230.     ReadLn(Input);
  231.     If Input<>'' then Node.Node:=Input;
  232.   End; (* End NodeIDNumber *)
  233.  
  234.   Procedure NetBases;
  235.   Begin
  236.     ClrScr;
  237.     WriteLn('To Change the status of a base ID Number to network, just enter the');
  238.     WriteLn('The Base Number to change. When you are finished, just enter a "0"');
  239.     WriteLn;
  240.     Repeat
  241.       Write('Base ID To change:');
  242.       ReadLn(Input);
  243.       I:=Valu(Input);
  244.       If (I>0) and (I<256) then Begin
  245.          Node.BaseSelection[I]:=Not Node.BaseSelection[I];
  246.          If Node.BaseSelection[I] then WriteLn('Base ID:',i,' WILL be networked.')
  247.          Else
  248.          WriteLn('Base ID:',I,'Will NOT be networked.');
  249.       End; (* End Conditional Begin *)
  250.     Until I=0; (* End Repeat Loop *)
  251.   End; (* End NetBases *)
  252.  
  253.   Begin (* Begin Main EditNode Loop *)
  254.     InitEditor;
  255.     ClrScr;
  256.     Write('Enter the Node to Edit: [1-',filesize(Fn),']:');
  257.     ReadLn(Input);
  258.     I:=Valu(Input);
  259.     If (I<1) or (I>FileSize(Fn)) then Else Begin
  260.       Seek(Fn,I-1);
  261.       Read(Fn,Node);
  262.       NodeNum:=i-1;
  263.       Repeat  (* Begin Main Repeat Loop *)
  264.         ClrScr;
  265.         Pull_Menu(EditMenu,Emajor,Eminor);
  266.         Case EMajor of
  267.           1:Case Eminor of
  268.               1:GetPhoneNum;
  269.               2:GetBaud;
  270.               3:GetName;
  271.               4:ShowNode;
  272.             End; (* End Eminor case *)
  273.           2:Case Eminor of
  274.               1:NodePassword;
  275.               2:NodeIDNumber;
  276.              End; (* End Case Eminor *)
  277.           3:NetBases;
  278.         End; (* End Case *)
  279.       Until Emajor=4; (* End Main Repeat Loop *)
  280.     Seek(Fn,NodeNum);
  281.     Write(Fn,Node);
  282.   End; (* End Conditional IF Then *)
  283. End; (* End EditNode *)
  284.  
  285.  
  286. Begin
  287.  InitializeThisStuff;
  288.  Repeat
  289.  ClrScr;
  290.  Pull_Menu(TheMenu,Major,Minor);
  291.  Case Major of
  292.    1:Case Minor of
  293.       1:DisplayNodeInformation;
  294.       2:EditNode;
  295.       3:DeleteNode;
  296.       End; (* End Case *)
  297.    2:AddNode;
  298.    3:AboutNodeEdit;
  299.  End;  (* End Case *)
  300.  Until Major=4;  (* End Repeat Loop *)
  301.  ClrScr;
  302.  WriteLn('Thank you for Choosing ViSiON BBS Software!');
  303.  GotoXy(23,10);
  304.  WriteLn('Cheap and Sleazy Node Editor');
  305.  GotoXy(22,11);
  306.  WriteLn('Written by Ken Sallot (c) 1990');
  307.  Close(Fn);
  308. End.        (* End Program *)
  309.  
  310.  
  311.  
  312.